package org.example.new_hbps_backend_reconstruction.common.results;

import java.util.HashSet;
import java.util.Set;

/**
 * @author 丁利军
 * @date 2025年10月10日 10:49
 * @description TODO: 描述
 */

public class ErrorMessage {
    private Long lineNum;
    private Set<String> errors = new HashSet();

    public ErrorMessage(Set<String> errors) {
        this.errors = errors;
    }

    public ErrorMessage(String error) {
        HashSet<String> objects = new HashSet();
        objects.add(error);
        this.errors = objects;
    }

    public Long getLineNum() {
        return this.lineNum;
    }

    public Set<String> getErrors() {
        return this.errors;
    }

    public void setLineNum(final Long lineNum) {
        this.lineNum = lineNum;
    }

    public void setErrors(final Set<String> errors) {
        this.errors = errors;
    }
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof ErrorMessage)) {
            return false;
        } else {
            ErrorMessage other = (ErrorMessage)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$lineNum = this.getLineNum();
                Object other$lineNum = other.getLineNum();
                if (this$lineNum == null) {
                    if (other$lineNum != null) {
                        return false;
                    }
                } else if (!this$lineNum.equals(other$lineNum)) {
                    return false;
                }

                Object this$errors = this.getErrors();
                Object other$errors = other.getErrors();
                if (this$errors == null) {
                    if (other$errors != null) {
                        return false;
                    }
                } else if (!this$errors.equals(other$errors)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof ErrorMessage;
    }
    @Override
    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $lineNum = this.getLineNum();
        result = result * 59 + ($lineNum == null ? 43 : $lineNum.hashCode());
        Object $errors = this.getErrors();
        result = result * 59 + ($errors == null ? 43 : $errors.hashCode());
        return result;
    }
    @Override
    public String toString() {
        Long var10000 = this.getLineNum();
        return "ErrorMessage(lineNum=" + var10000 + ", errors=" + this.getErrors() + ")";
    }

    public ErrorMessage() {
    }

    public ErrorMessage(final Long lineNum, final Set<String> errors) {
        this.lineNum = lineNum;
        this.errors = errors;
    }
}

